tongfusoft.fileTransferResume = function() {
}

tongfusoft.fileTransferResume.prototype = {

	

	initTable : function() {

		var table = new tongfusoft.table();
		var columns = [
				{
					"data" : "id"
				},
				{
					"data" : "fileName"
				},
				{
					"data" : "fileSize",
					"render" : function(data, type, full, meta) {


						return (parseInt(data)/1024/1024/1024).toFixed(4);
					}
				},
				{
					"data" : "createdDate"
				},
				{
					"data" : "id",
					"render" : function(data, type, full, meta) {

						var delbut = '<button fileId="'
								+ data
								+ '" onclick="new tongfusoft.fileTransferResume().del(this)" type="button" data-toggle="modal" data-target="#dellass" class="detBtn btn btn-default btn-sm "><em class="fa fa-trash"></em></button>'

						return delbut;
					}

				} ]

		table.dataTable('bigFileTable', 'bigFile/query', columns, null);

	},
	// 删除
	del : function(obj) {

		swal({
			title : "是否确认删除?",
			text : "",
			type : "warning",
			showCancelButton : true,
			confirmButtonColor : "#DD6B55",
			confirmButtonText : "删除",
			cancelButtonText : "取消",
			closeOnConfirm : true
		}, function() {
			common.ajaxSubmitOnSuccess({}, 'fileDel/'+$(obj).attr("fileId"), function(data) {

				if (data.state == 'success') {

					$('#bigFileTable').DataTable().ajax.reload();
				}

			}, "del")
		});

	},
	init : function() {

		
	
	


	}

}



$(function() {
	var upload = bigFile.create({
		prepareNextFile : true,
		fileId : 'fileupload_big',
		url : 'fileTransferResume/upload',
		finishListUrl:'/fileFragment/query',
		validateMd5ExistUrl:'bigFile/isExist',
		
		
	})

});